﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Imports Utilerias
Imports Npgsql
Imports MySql.Data.MySqlClient
Public Class SerieFact
    Public Shared Function Build(ByVal dr As MySqlDataReader) As SerieBE
        Dim tmpSerie As SerieBE = New SerieBE()
        Try
            With tmpSerie
                '.IdSerie = convertDTFromDb.convertInt32(dr.Item("IdSerie"))
                .Serie = convertDTFromDb.ConvertString(dr.Item("Serie"))
                .FolioInicial = convertDTFromDb.convertInt32(dr.Item("FolioInicial"))
                .FolioSiguiente = convertDTFromDb.convertInt32(dr.Item("FolioSiguiente"))
                .Expedidos = convertDTFromDb.convertInt32(dr.Item("Expedidos"))
                .NombreReporte = convertDTFromDb.ConvertString(dr.Item("NombreReporte"))
                .NumSerieCertificado = convertDTFromDb.ConvertString(dr.Item("NumCertif"))
                If (convertDTFromDb.ConvertString(dr.Item("Estatus") = "A")) Then
                    .Estatus = SerieBE.EnumEstatus.Activo
                Else
                    .Estatus = SerieBE.EnumEstatus.Inactivo
                End If
            End With
            Return tmpSerie
        Catch ex As Exception
            Throw
        Finally
            tmpSerie = Nothing
        End Try
    End Function
End Class
